package com.xiaoyushu.user.api;


import com.xiaoyushu.framework.common.response.Response;
import com.xiaoyushu.user.constant.ApiConstants;
import com.xiaoyushu.user.dto.req.*;
import com.xiaoyushu.user.dto.resp.FindUserByIdRspDTO;
import com.xiaoyushu.user.dto.resp.FindUserByPhoneRspDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = ApiConstants.SERVICE_NAME)
public interface UserFeignApi {
    String PREFIX= "/user";

    /**
     * 用户注册
     */
    @PostMapping(value = PREFIX+"/register")
    Response<Long> registerUser(@RequestBody  RegisterUserReqDTO registerUserReqDTO);

    @PostMapping(value = PREFIX+"/findByPhone")
    Response<FindUserByPhoneRspDTO> findUserByPhone(@RequestBody FindUserByPhoneReqDTO findUserByPhoneReqDTO);


    @PostMapping(value = PREFIX+"/password/update")
    Response<?> updatePassword(@RequestBody UpdateUserPasswordReqDTO updateUserPasswordReqDTO);


    @PostMapping(value = PREFIX+"/findById")
    Response<FindUserByIdRspDTO> findById(@RequestBody FindUserByIdReqDTO findUserByIdReqDTO);

    @PostMapping(value = PREFIX +"/findByIds")
    Response<List<FindUserByIdRspDTO>> findByIds(@RequestBody FindUsersByIdsReqDTO findUsersByIdsReqDTO);
}
